glcontext: Fix buffer age comparison
authorTimm Bäder <mail@baedert.org>
Tue, 21 Mar 2017 18:03:27 +0000 (19:03 +0100)
committerTimm Bäder <mail@baedert.org>
Tue, 21 Mar 2017 18:04:58 +0000 (19:04 +0100)
The old code had a dead >=3 branch, causing flickering.

gdk/wayland/gdkglcontext-wayland.c
gdk/x11/gdkglcontext-x11.c

index f75e2108cc0754529662a8e923a8eecf5df8fd93..82233cfb20bec6b9662879fd4a8bca9ccd81fdfb 100644 (file)
@@ -180,12 +180,12 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
       eglQuerySurface (display_wayland->egl_display, egl_surface,
                        EGL_BUFFER_AGE_EXT, &buffer_age);
 
-      if (buffer_age >= 2)
+      if (buffer_age == 2)
         {
           if (window->old_updated_area[0])
             return cairo_region_copy (window->old_updated_area[0]);
         }
-      else if (buffer_age >= 3)
+      else if (buffer_age == 3)
         {
           if (window->old_updated_area[0] &&
               window->old_updated_area[1])
index 8eb2cab1c0d3a61b77fad5e52941734a02bf7935..d76c29e6aafd24e05f44eadd44979b6602635294 100644 (file)
@@ -212,12 +212,12 @@ gdk_x11_gl_context_get_damage (GdkGLContext *context)
       glXQueryDrawable(dpy, shared_x11->attached_drawable,
                       GLX_BACK_BUFFER_AGE_EXT, &buffer_age);
 
-      if (buffer_age >= 2)
+      if (buffer_age == 2)
         {
           if (window->old_updated_area[0])
             return cairo_region_copy (window->old_updated_area[0]);
         }
-      else if (buffer_age >= 3)
+      else if (buffer_age == 3)
         {
           if (window->old_updated_area[0] &&
               window->old_updated_area[1])